/*
 * @Description: 
 * @Author: lgt
 * @Date: 2021-06-26 10:49:48
 * @LastEditTime: 2021-06-27 10:32:37
 * @LastEditors: xxx
 */
const Koa = require('koa'); //导入koa包
const Router = require('koa-router');
const parser = require('koa-bodyparser');
const catchError = require("./middlewares/exception")


const router = new Router();
const InitManager = require("./core/init")



const app = new Koa();
app.use(catchError);//捕捉错误中间件
app.use(parser())
InitManager.initCore(app);

router.get('/',(ctx,next)=>{
	//内容
    ctx.body = {
        key:'aaaa'
    }
})

process.cwd(); //获取当前路径

app.use(router.routes()).use(router.allowedMethods());

app.listen(3355,()=>{
	console.log("[端口号 3355]启动服务")
})